/*
 * The Vue build version to load with the `import` command
 * (runtime-only or standalone) has been set in webpack.base.conf with an alias.
 */

import Vue from 'vue'
import App from './App.vue'
import router from './js/app/router/index.js'
import ArteryUI from './components/index.js'
import markdown from './components/markdown.js'
// 使用artery-ui
Vue.use(ArteryUI, {})
Vue.use(markdown, {})
/*
 *Vue.config.productionTip = false;
 *console.log(Artery)
 *Vue.config.debug = true;
 */
/* eslint-disable no-new */
var timing = window.performance.timing
// console.log(timing.domContentLoadedEventStart);
new Vue({
  el: '#app',
  router,
  components: { App },
  template: '<App/>',
  mounted () {
    this.$router.beforeEach((to, from, next) => {
      /*
       *console.log(to)
       * console.log(from)
       * console.log(next)
       */
      this.$LoadingBar.start()
      // 本地路由太快，为了能展示效果故意加了延迟
      setTimeout(next, 400)
      //
    })
    this.$router.afterEach(item => {
      this.$LoadingBar.finish()
    })
    /*
     *   console.log(  timing.domLoading);
     * console.log(  timing.domInteractive );
     * console.log( timing.domContentLoadedEventEnd)
     * console.log( timing.domComplete )
     *console.log(timing)
     */
  }
})
